﻿Imports System.Data.OleDb

Public Class CellEvent
    Inherits SourceGrid.Cells.Controllers.ControllerBase
    Public Overrides Sub OnClick(ByVal sender As SourceGrid.CellContext, ByVal e As System.EventArgs)
        Try

            MyBase.OnClick(sender, e)
            Dim cellLink As SourceGrid.Cells.Link = sender.Cell

            'Dim SoHoaDon As String = sender.Value
            Dim IDDonHangBan As Integer
            If Not String.IsNullOrEmpty(cellLink.Tag.ToString()) Then
                IDDonHangBan = Integer.Parse(cellLink.Tag.ToString())
                'Dim dbConn As New OleDb.OleDbConnection
                'Dim dataAccess As New DataAccess
                'Dim dbCommand As OleDb.OleDbCommand
                'dataAccess.ConnectDatabase_DBAccess(dbConn)
                'dbCommand = New OleDbCommand("sp_DonHang_SoHoaDon_IDDonHangBan", dbConn)
                'dbCommand.CommandType = CommandType.StoredProcedure
                'dbCommand.Parameters.Add("@SoHoaDon", OleDbType.VarWChar).Value = SoHoaDon
                'IDDonHangBan = Integer.Parse(dbCommand.ExecuteScalar().ToString())
                'dbCommand.Dispose()
                'dbConn.Close()
                frmXemDonHang.IDDonHangBan = Integer.Parse(IDDonHangBan)
                frmXemDonHang.ShowDialog()
            End If
        Catch ex As Exception
            MessageBox.Show("Có lỗi trong quá trình xử lý. Vui lòng thực hiện lại!", "Thông báo", MessageBoxButtons.OK)
        End Try
    End Sub

End Class
